const db = require('./index');
const Schema = db.Schema;

/**
 * 外科治疗模版
 * 
 */

const SurgicalTreatmentSchema = new Schema({
    name: { type: String, require: true },//模版名称
    department: { type: String, require: true },//关联科室
    doctor: { type: String, require: true },//医生ID
    code: { type: String, require: true },//模板简码 (小写的名称首字母 例: 头晕  ty)
    //用药，治疗项目详情
    project: {},
    //p_name:string 服务名称
    //p_count:number   次数
    //p_price:number    单价
    //p_speci:number    规格
    //p_summoney:number 总价
    //p_discount:bool   是否允许折扣
    consumptionmoney: { type: Number, require: true },//治疗总价格
    receipts: { type: Number, require: true },//成本总价格
    state: { type: Boolean, require: true, default: true }
});

const SurgicalTreatment = db.model('SurgicalTreatment', SurgicalTreatmentSchema);
module.exports = SurgicalTreatment;